1 //+------------------------------------------------------------------+
\r
2 //| Meta COT Percent Position in OI.mq4 |
\r
3 //| Copyright © 2009, C-4 (Vasiliy Sokolov, Russia, St.-Petersburg,|
\r
4 //| 2009), All Rights Reserved. |
\r
6 //+------------------------------------------------------------------+
\r
8 // Ïîêàçûâàåò îòíîøåíÿ îäíîé èç àáñîëþòíîé ïîçèöèé ó÷àñòíèêîâ ê îòêðûòîìó èíòåðåñó.
\r
10 #property copyright "Copyright © 2009, C-4 (Vasiliy Sokolov, SPb), All Rights Reserved."
\r
11 #property link "vs-box@mail.ru"
\r
13 #property indicator_separate_window
\r
14 #property indicator_buffers 6
\r
15 #property indicator_color1 Blue
\r
16 #property indicator_color2 SkyBlue
\r
17 #property indicator_color3 IndianRed
\r
18 #property indicator_color4 Red
\r
19 #property indicator_color5 Silver
\r
20 #property indicator_color6 SlateGray
\r
23 int movement_index=6;
\r
24 extern bool Show_iNoncomm_Long=false;
\r
25 extern bool Show_iNoncomm_Short=false;
\r
26 extern bool Show_iOperators_Long=false;
\r
27 extern bool Show_iOperators_Short=false;
\r
28 extern bool Show_iNonrep_Long=false;
\r
29 extern bool Show_iNonrep_Short=false;
\r
31 double i_noncomm_long[];
\r
32 double i_noncomm_short[];
\r
33 double i_operators_long[];
\r
34 double i_operators_short[];
\r
35 double i_nonrep_long[];
\r
36 double i_nonrep_short[];
\r
38 #include <cotlib.mq4>
\r
42 if(init_data()==false)error=true;
\r
43 if(error==false)load_data();
\r
44 if(error==false)count_data();
\r
45 //if(error==false)count_index(period);
\r
51 if(error==true)Print("Íå óäàëîñü çàãðóçèòü äàííûå. Äàëüíåéøàÿ ðàáîòà íåâîçìîæíà");
\r
52 if(DrawData==true)DrowData();
\r
57 SetIndexStyle(0,DRAW_LINE);
\r
58 SetIndexStyle(1,DRAW_LINE);
\r
59 SetIndexStyle(2,DRAW_LINE);
\r
60 SetIndexStyle(3,DRAW_LINE);
\r
61 SetIndexStyle(4,DRAW_LINE);
\r
62 SetIndexStyle(5,DRAW_LINE);
\r
63 SetIndexStyle(6,DRAW_LINE);
\r
65 SetIndexEmptyValue(0,EMPTY_VALUE);
\r
66 SetIndexEmptyValue(1,EMPTY_VALUE);
\r
67 SetIndexEmptyValue(2,EMPTY_VALUE);
\r
68 SetIndexEmptyValue(3,EMPTY_VALUE);
\r
69 SetIndexEmptyValue(4,EMPTY_VALUE);
\r
70 SetIndexEmptyValue(5,EMPTY_VALUE);
\r
71 SetIndexEmptyValue(6,EMPTY_VALUE);
\r
72 SetLevelValue(0,0.0);
\r
73 SetLevelValue(1,20.0);
\r
74 SetLevelValue(2,50.0);
\r
75 SetLevelValue(3,80.0);
\r
76 SetLevelValue(4,100.0);
\r
77 if(load_cot_file==true)IndicatorShortName(StringConcatenate("Meta COT % Pos. in OI: ", str_trim(cot_file)));
\r
78 else IndicatorShortName(StringConcatenate("Meta COT % Pos. in OI: ", name));
\r
79 if(Show_iNoncomm_Long==true){
\r
80 SetIndexBuffer(0,i_noncomm_long);
\r
81 SetIndexLabel(0, "% Noncomm Long in OI");
\r
83 if(Show_iNoncomm_Short==true){
\r
84 SetIndexBuffer(1,i_noncomm_short);
\r
85 SetIndexLabel(1,"% Noncomm Short in OI");
\r
87 if(Show_iOperators_Long==true){
\r
88 SetIndexBuffer(2,i_operators_long);
\r
89 SetIndexLabel(2,"% Operators Long in OI");
\r
91 if(Show_iOperators_Short==true){
\r
92 SetIndexBuffer(3,i_operators_short);
\r
93 SetIndexLabel(3,"% Operators Short in OI");
\r
95 if(Show_iNonrep_Long==true){
\r
96 SetIndexBuffer(4,i_nonrep_long);
\r
97 SetIndexLabel(4,"% Nonrep Long in OI");
\r
99 if(Show_iNonrep_Short==true){
\r
100 SetIndexBuffer(5,i_nonrep_short);
\r
101 SetIndexLabel(5,"% Nonrep Short in OI");
\r
107 int end_data=get_lastdata();
\r
108 for(int i=0;i<end_data;i++){
\r
109 if(Show_iNoncomm_Long==true)i_noncomm_long[i]=get_data(OI_NONCOMM_LONG,i);
\r
110 if(Show_iNoncomm_Short==true)i_noncomm_short[i]=get_data(OI_NONCOMM_SHORT,i);
\r
111 if(Show_iOperators_Long==true)i_operators_long[i]=get_data(OI_OPERATORS_LONG,i);
\r
112 if(Show_iOperators_Short==true)i_operators_short[i]=get_data(OI_OPERATORS_SHORT,i);
\r
113 if(Show_iNonrep_Long==true)i_nonrep_long[i]=get_data(OI_NONREP_LONG,i);
\r
114 if(Show_iNonrep_Short==true)i_nonrep_short[i]=get_data(OI_NONREP_SHORT,i);
\r